﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebApp.App.Code.Cms
{
    public class Config
    {
        private static Dictionary<string, string> configs = null;
        public Config()
        {
            if (configs == null)
            {
                Models.DAL.Cms.SysConfig sysConfig = new Models.DAL.Cms.SysConfig();
                configs = sysConfig.GetConfigs();
            }
        }
        /// <summary>
        /// 获取全局变量
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public string GetValue(string key)
        {
            return configs[key];
        }
        /// <summary>
        /// 主站名称
        /// </summary>
        public string webname
        {
            get { return configs["webname"]; }
        }
        /// <summary>
        /// 主站域名
        /// </summary>
        public string weburl
        {
            get { return configs["weburl"]; }
        }
        /// <summary>
        /// 公司名称
        /// </summary>
        public string webcompany
        {
            get { return configs["webcompany"]; }
        }
        /// <summary>
        /// 公司地址
        /// </summary>
        public string webaddress
        {
            get { return configs["webaddress"]; }
        }
        /// <summary>
        /// 联系电话
        /// </summary>
        public string webtel
        {
            get { return configs["weburl"]; }
        }
        /// <summary>
        /// 传真号码
        /// </summary>
        public string webfax
        {
            get { return configs["webfax"]; }
        }
        /// <summary>
        /// 管理员邮箱
        /// </summary>
        public string webmail
        {
            get { return configs["webmail"]; }
        }
        /// <summary>
        /// 网站备案号
        /// </summary>
        public string webcrod
        {
            get { return configs["webcrod"]; }
        }
    }

}